# read user vectors and add them in a list
# list should be in the form of [(userid, vector)]
# dictionary should be {userid: vector}
# call method to cluster users according to their vector
# get resulting clusters
from collections import Counter

from january_scripts import ict4growth


Users = [("user1", Counter({"book1": 4, "book2": 5})), ("user2", Counter({"book2": 4}))]

Clusters = ict4growth.create_clusters(Users, 0.78)

for cluster in Clusters:
    print cluster, Clusters[cluster]["items"], Clusters[cluster]["vector"]
